import {baseUrl} from "@/config/env";

export default () => {
    return {
        submitText: '修改',
        size: 'small',
        labelWidth: 120,
        index: true,
        indexLabel: "序号",
        menuAlign: 'center',
        menuPosition: "right",
        searchIndex: 1,
        searchIcon: true,
        filterBtn: true,
        permissionBtn: {
            addBtn: 'sys:sysUploadFileManger:add',
            editBtn: 'sys:sysUploadFileManger:edit',
            viewBtn: 'sys:sysUploadFileManger:info',
            delBtn: 'sys:sysUploadFileManger:delete',
        },
        column: [

            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "文件id",
                "prop": "id",
                "hide": true,
                "type": "input"
            },
            {
                "addDisplay": false,
                "editDetail": true,
                "label": "文件名称",
                "prop": "ossName",
                "showColumn": true,
                "type": "input",
                width: 200,
            }, {
                "addDisplay": false,
                "editDetail": true,
                "label": "类型",
                width: 60,
                "prop": "fileType",
                "showColumn": true,
                "type": "input"
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "文件存储器类型",
                "prop": "ossStorageType",
                "showColumn": true,
                width: 120,
                "type": "select",
                dicUrl: baseUrl + "/sysDictionaryItem/listByDictionaryCode",
                dicMethod: "get",
                dicQuery: {code: "start_oss_storage_type"},
                defaultFirstOption:{},
                props: {
                    label: 'name',
                    value: 'dictionaryValue',
                },
            },
            {
                "addDisplay": false,
                "editDetail": true,
                "label": "文件本地路径",
                "prop": "ossLocalPath",
                "showColumn": true,
                "type": "input",
                overHidden: true,
            },
            {
                "addDisplay": false,
                "editDetail": true,
                "label": "文件唯一编码",
                "prop": "ossUniqueCode",
                "hide": true,
                "type": "input"
            },
            {
                label: '文件',
                row: true,
                accept: "image/*",
                prop: 'ossUrl',
                type: "upload",
                limit: 1,
                listType: 'picture-card',
                action: `${baseUrl}/start/resource/formUpload`,
                propsHttp: {
                    name: 'fileName',
                    res: 'data',
                    url: 'ossUrl',
                },
                rules: [{
                    required: false,
                    trigger: "blur"
                }]
            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "创建时间",
                "prop": "createTime",
                "hide": true,
                "type": "datetime"
            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "文件上传人",
                "prop": "createBy",
                "hide": true,
                "type": "input"
            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "修改时间",
                "prop": "updateTime",
                "hide": true,
                "type": "datetime"
            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "修改人",
                "prop": "updateBy",
                "hide": true,
                "type": "datetime"
            }
        ]

    }
}
